<template>
    <yd-popup v-model="messagePopup.isShow" position="center" width="70%" :close-on-masker="false" masker-opacity=".7">
        <div class="message">
            <i class="font_family icon-cha message-close" @click="cloneMessagePopup"></i>
            <i :class="{
                    'font_family': true,
                    'message-icon': true,
                    'icon-zhengquex': messagePopup.type == 'success',
                    'icon-fuhao-zhuangtai-jinggaox': messagePopup.type == 'error'
                }"></i>
            <h4 class="message-title">{{ messagePopup.title }}</h4>
            <p class="message-text">{{ messagePopup.text }}</p>
        </div>
    </yd-popup>
</template>

<script>
    export default {
        name: "alert",
        props:{
            messagePopup: {
                type: Object,
                required: false,
                default(){
                    return {
                        isShow: false,
                        type: 'success',
                        title: "标题",
                        text: "描述"
                    }
                }
            }
        },
        methods: {
            cloneMessagePopup(){
                this.messagePopup.isShow = false
            }
        }
    }
</script>
